package com.bagus.mediapipefacedetection.module.detect;

import android.graphics.SurfaceTexture;

import com.bagus.mediapipefacedetection.constant.ErrorType;
import com.bagus.mediapipefacedetection.listener.ResultEntity;
import com.bagus.mediapipefacedetection.manager.DetectQualityManager;
import com.bagus.mediapipefacedetection.module.base.BaseView;
import com.bagus.mediapipefacedetection.quality.DetectQualityInfo;
import com.bagus.mediapipefacedetection.quality.DetectQualityStatus;
import com.google.mediapipe.formats.proto.LandmarkProto;

import java.util.List;

public class DetectContract {
    public interface View extends BaseView {
        SurfaceTexture getSurfaceTexture();

        void initFinish();

        void setUserTips(int tipsType);

        void showStatics(String statics);

        void showLoadingProgress();

        void cameraOpened();

        void detectFinish(ErrorType errorType, ResultEntity result);

        void onExit(ErrorType errorType, ResultEntity result);
    }

    public interface Model {
//        boolean init(byte[] trackModel, byte[] mouthModel, byte[] eyeModel, byte[] poseModel, byte[] blurModel);

//        DetectQualityInfo detect(int imageMode, byte[] yuvImageData, int imageWidth, int imageHeight, int angle);
        DetectQualityInfo detect(int imageMode, List<LandmarkProto.NormalizedLandmark> landmarks, int imageWidth, int imageHeight);
        void release();

        void startDetect();

        void stopDetect();

        void reset();

        DetectQualityStatus getQualityStatus(DetectQualityInfo info);

        DetectQualityManager getQualityManager();
    }

    public interface Presenter {
        void init();

        boolean startPreview();

        void stopPreview();

        void switchCamera();

        void startDetect();

        void stopDetect();

        boolean isCameraOpenSuccess();
    }
}
